# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.930.107.7 -> 1.930.107.8 # mm/mmap.c 1.29.1.3 -> 1.29.1.4 # arch/ia64/kernel/ivt.S 1.7 -> 1.8 # arch/ia64/mm/Makefile 1.1.1.2 -> 1.1.1.3 # mm/memory.c 1.54.1.3 -> 1.54.1.4 # arch/ia64/mm/hugetlbpage.c 1.1 -> 1.2 # ipc/shm.c 1.12 -> 1.13 # arch/ia64/config.in 1.13.2.2 -> 1.13.2.3 # fs/hugetlbfs/inode.c 1.1 -> 1.2 # arch/ia64/kernel/sys_ia64.c 1.8.1.1 -> 1.8.1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/05/19 bjorn_helgaas@hp.com 1.930.107.8 # Whitespace cleanup from hugetlb patch. # -------------------------------------------- # diff -Nru a/arch/ia64/config.in b/arch/ia64/config.in --- a/arch/ia64/config.in Wed Oct 8 09:06:58 2003 +++ b/arch/ia64/config.in Wed Oct 8 09:06:58 2003 @@ -91,27 +91,26 @@ bool 'IA-64 Huge TLB Page Support' CONFIG_HUGETLB_PAGE if [ "$CONFIG_HUGETLB_PAGE" = "y" ]; then - if [ "$CONFIG_MCKINLEY" = "y" ]; then - choice ' IA-64 Huge TLB Page Size' \ - "4GB CONFIG_HUGETLB_PAGE_SIZE_4GB \ - 1GB CONFIG_HUGETLB_PAGE_SIZE_1GB \ - 256MB CONFIG_HUGETLB_PAGE_SIZE_256MB \ - 64MB CONFIG_HUGETLB_PAGE_SIZE_64MB \ - 16MB CONFIG_HUGETLB_PAGE_SIZE_16MB \ - 4MB CONFIG_HUGETLB_PAGE_SIZE_4MB \ - 1MB CONFIG_HUGETLB_PAGE_SIZE_1MB \ - 256KB CONFIG_HUGETLB_PAGE_SIZE_256KB" 16MB - else - choice ' IA-64 Huge TLB Page Size' \ - "256MB CONFIG_HUGETLB_PAGE_SIZE_256MB \ - 64MB CONFIG_HUGETLB_PAGE_SIZE_64MB \ - 16MB CONFIG_HUGETLB_PAGE_SIZE_16MB \ - 4MB CONFIG_HUGETLB_PAGE_SIZE_4MB \ - 1MB CONFIG_HUGETLB_PAGE_SIZE_1MB \ - 256KB CONFIG_HUGETLB_PAGE_SIZE_256KB" 16MB - fi + if [ "$CONFIG_MCKINLEY" = "y" ]; then + choice ' IA-64 Huge TLB Page Size' \ + "4GB CONFIG_HUGETLB_PAGE_SIZE_4GB \ + 1GB CONFIG_HUGETLB_PAGE_SIZE_1GB \ + 256MB CONFIG_HUGETLB_PAGE_SIZE_256MB \ + 64MB CONFIG_HUGETLB_PAGE_SIZE_64MB \ + 16MB CONFIG_HUGETLB_PAGE_SIZE_16MB \ + 4MB CONFIG_HUGETLB_PAGE_SIZE_4MB \ + 1MB CONFIG_HUGETLB_PAGE_SIZE_1MB \ + 256KB CONFIG_HUGETLB_PAGE_SIZE_256KB" 16MB + else + choice ' IA-64 Huge TLB Page Size' \ + "256MB CONFIG_HUGETLB_PAGE_SIZE_256MB \ + 64MB CONFIG_HUGETLB_PAGE_SIZE_64MB \ + 16MB CONFIG_HUGETLB_PAGE_SIZE_16MB \ + 4MB CONFIG_HUGETLB_PAGE_SIZE_4MB \ + 1MB CONFIG_HUGETLB_PAGE_SIZE_1MB \ + 256KB CONFIG_HUGETLB_PAGE_SIZE_256KB" 16MB + fi fi - bool 'SMP support' CONFIG_SMP tristate 'Support running of Linux/x86 binaries' CONFIG_IA32_SUPPORT diff -Nru a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S --- a/arch/ia64/kernel/ivt.S Wed Oct 8 09:06:58 2003 +++ b/arch/ia64/kernel/ivt.S Wed Oct 8 09:06:58 2003 @@ -131,8 +131,8 @@ ;; cmp.eq p8,p0=HPAGE_SHIFT,r26 ;; -(p8) dep r25=r18,r25, 2, 6 -(p8) shr r22=r22,HPAGE_SHIFT-PAGE_SHIFT //Changed r16 to r22 below +(p8) dep r25=r18,r25,2,6 +(p8) shr r22=r22,HPAGE_SHIFT-PAGE_SHIFT #endif ;; cmp.eq p6,p7=5,r17 // is IFA pointing into to region 5? @@ -147,7 +147,7 @@ (p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8 (p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8) cmp.eq p7,p6=0,r21 // unused address bits all zeroes? - shr.u r18=r22,PMD_SHIFT //shift L2 index into position + shr.u r18=r22,PMD_SHIFT // shift L2 index into position ;; ld8 r17=[r17] // fetch the L1 entry (may be 0) ;; @@ -175,7 +175,7 @@ mov cr.ifa=r22 #ifdef CONFIG_HUGETLB_PAGE -(p8) mov cr.itir=r25 // Change the page size to 16k for VHPT +(p8) mov cr.itir=r25 // change to default page-size for VHPT #endif /* diff -Nru a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c --- a/arch/ia64/kernel/sys_ia64.c Wed Oct 8 09:06:58 2003 +++ b/arch/ia64/kernel/sys_ia64.c Wed Oct 8 09:06:58 2003 @@ -15,12 +15,11 @@ #include #include #include +#include #include #include -#include - unsigned long arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags) @@ -32,8 +31,8 @@ if (len > RGN_MAP_LIMIT) return -ENOMEM; #ifdef CONFIG_HUGETLB_PAGE - if(rgn_index(addr)==REGION_HPAGE) - addr=0; + if (rgn_index(addr)==REGION_HPAGE) + addr = 0; #endif if (!addr) addr = TASK_UNMAPPED_BASE; diff -Nru a/arch/ia64/mm/Makefile b/arch/ia64/mm/Makefile --- a/arch/ia64/mm/Makefile Wed Oct 8 09:06:58 2003 +++ b/arch/ia64/mm/Makefile Wed Oct 8 09:06:58 2003 @@ -12,6 +12,6 @@ export-objs := init.o obj-y := init.o fault.o tlb.o extable.o -obj-$(CONFIG_HUGETLB_PAGE)+=hugetlbpage.o +obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o include $(TOPDIR)/Rules.make diff -Nru a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c --- a/arch/ia64/mm/hugetlbpage.c Wed Oct 8 09:06:58 2003 +++ b/arch/ia64/mm/hugetlbpage.c Wed Oct 8 09:06:58 2003 @@ -50,8 +50,8 @@ return page; } -pte_t * -huge_pte_alloc(struct mm_struct *mm, unsigned long addr) +static pte_t * +huge_pte_alloc (struct mm_struct *mm, unsigned long addr) { unsigned long taddr = htlbpage_to_page(addr); pgd_t *pgd; @@ -65,8 +65,8 @@ return pte; } -pte_t * -huge_pte_offset(struct mm_struct *mm, unsigned long addr) +static pte_t * +huge_pte_offset (struct mm_struct *mm, unsigned long addr) { unsigned long taddr = htlbpage_to_page(addr); pgd_t *pgd; @@ -79,11 +79,11 @@ return pte; } -#define mk_pte_huge(entry) {pte_val(entry) |= _PAGE_P;} +#define mk_pte_huge(entry) { pte_val(entry) |= _PAGE_P; } -void -set_huge_pte(struct mm_struct *mm, struct vm_area_struct *vma, - struct page *page, pte_t * page_table, int write_access) +static void +set_huge_pte (struct mm_struct *mm, struct vm_area_struct *vma, + struct page *page, pte_t * page_table, int write_access) { pte_t entry; @@ -98,35 +98,33 @@ set_pte(page_table, entry); return; } - /* * This function checks for proper alignment of input addr and len parameters. */ int is_aligned_hugepage_range(unsigned long addr, unsigned long len) { - if (len & ~HPAGE_MASK) - return -EINVAL; - if (addr & ~HPAGE_MASK) - return -EINVAL; - if (REGION_NUMBER(addr) != REGION_HPAGE) - return -EINVAL; - return 0; -} + if (len & ~HPAGE_MASK) + return -EINVAL; + if (addr & ~HPAGE_MASK) + return -EINVAL; + if (REGION_NUMBER(addr) != REGION_HPAGE) + return -EINVAL; + return 0; +} /* This function checks if the address and address+len falls out of HugeTLB region. It * return -EINVAL if any part of address range falls in HugeTLB region. */ int is_invalid_hugepage_range(unsigned long addr, unsigned long len) { - if (REGION_NUMBER(addr) == REGION_HPAGE) - return -EINVAL; - if (REGION_NUMBER(addr+len) == REGION_HPAGE) - return -EINVAL; - return 0; + if (REGION_NUMBER(addr) == REGION_HPAGE) + return -EINVAL; + if (REGION_NUMBER(addr+len) == REGION_HPAGE) + return -EINVAL; + return 0; } -int -copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, +int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma) { pte_t *src_pte, *dst_pte, entry; @@ -147,7 +145,6 @@ addr += HPAGE_SIZE; } return 0; - nomem: return -ENOMEM; } @@ -287,7 +284,7 @@ } unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, - unsigned long pgoff, unsigned long flags) + unsigned long pgoff, unsigned long flags) { struct vm_area_struct *vmm; @@ -309,7 +306,6 @@ addr = COLOR_HALIGN(vmm->vm_end); } } - void update_and_free_page(struct page *page) { int j; @@ -330,8 +326,7 @@ int try_to_free_low(int count) { struct list_head *p; - struct page *page; - struct page *map; + struct page *page, *map; map = NULL; spin_lock(&htlbpage_lock); @@ -347,7 +342,6 @@ page = list_entry(p, struct page, list); if ((page_zone(page))->name[0] != 'H') //Look for non-Highmem zones. map = page; - } if (map) { list_del(&map->list); @@ -371,7 +365,8 @@ else lcount = count - htlbzone_pages; - if (lcount == 0) return (int)htlbzone_pages; + if (lcount == 0) + return (int)htlbzone_pages; if (lcount > 0) { /* Increase the mem size. */ while (lcount--) { page = alloc_pages(__GFP_HIGHMEM, HUGETLB_PAGE_ORDER); @@ -457,12 +452,12 @@ return 1; } -static struct page * hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int unused) +static struct page *hugetlb_nopage(struct vm_area_struct * area, unsigned long address, int unused) { BUG(); return NULL; } struct vm_operations_struct hugetlb_vm_ops = { - .nopage = hugetlb_nopage, + .nopage = hugetlb_nopage, }; diff -Nru a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c --- a/fs/hugetlbfs/inode.c Wed Oct 8 09:06:58 2003 +++ b/fs/hugetlbfs/inode.c Wed Oct 8 09:06:58 2003 @@ -190,12 +190,14 @@ return -EINVAL; } -static int hugetlbfs_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int hugetlbfs_prepare_write(struct file *file, + struct page *page, unsigned offset, unsigned to) { return -EINVAL; } -static int hugetlbfs_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int hugetlbfs_commit_write(struct file *file, + struct page *page, unsigned offset, unsigned to) { return -EINVAL; } @@ -280,7 +282,8 @@ hugetlbfs_forget_inode(inode); } -static void hugetlb_vmtruncate_list(struct vm_area_struct *mpnt, unsigned long pgoff) +static void +hugetlb_vmtruncate_list(struct vm_area_struct *mpnt, unsigned long pgoff) { do { @@ -318,7 +321,6 @@ } while ((mpnt = mpnt->vm_next_share) != NULL); } - /* * Expanding truncates are not allowed. */ @@ -329,10 +331,10 @@ if (offset > inode->i_size) return -EINVAL; - + BUG_ON(offset & ~HPAGE_MASK); pgoff = offset >> HPAGE_SHIFT; - + spin_lock(&mapping->i_shared_lock); if (mapping->i_mmap != NULL) hugetlb_vmtruncate_list(mapping->i_mmap, pgoff); @@ -343,7 +345,6 @@ truncate_hugepages(inode, mapping, offset); inode->i_size = offset; return 0; - } static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr) @@ -364,7 +365,6 @@ error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0; if (error) goto out; - if (ia_valid & ATTR_SIZE) { error = -EINVAL; if (!(attr->ia_size & ~HPAGE_MASK)) @@ -385,7 +385,8 @@ return error; } -struct inode *hugetlbfs_get_inode(struct super_block *sb, int mode, int dev) +static struct inode *hugetlbfs_get_inode(struct super_block *sb, + int mode, int dev) { struct inode * inode = new_inode(sb); @@ -423,7 +424,8 @@ * File creation. Allocate an inode, and we're done.. */ /* SMP-safe */ -static int hugetlbfs_mknod(struct inode *dir, struct dentry *dentry, int mode, int dev) +static int hugetlbfs_mknod(struct inode *dir, + struct dentry *dentry, int mode, int dev) { struct inode * inode = hugetlbfs_get_inode(dir->i_sb, mode, dev); int error = -ENOSPC; @@ -436,7 +438,7 @@ return error; } -static int hugetlbfs_mkdir(struct inode * dir, struct dentry * dentry, int mode) +static int hugetlbfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) { int retval = hugetlbfs_mknod(dir, dentry, mode | S_IFDIR, 0); // if (!retval) @@ -449,7 +451,8 @@ return hugetlbfs_mknod(dir, dentry, mode | S_IFREG, 0); } -static int hugetlbfs_symlink(struct inode * dir, struct dentry *dentry, const char * symname) +static int hugetlbfs_symlink(struct inode *dir, + struct dentry *dentry, const char *symname) { int error = -ENOSPC; @@ -463,41 +466,42 @@ } static struct address_space_operations hugetlbfs_aops = { -readpage : hugetlbfs_readpage, -writepage : fail_writepage, -prepare_write : hugetlbfs_prepare_write, -commit_write : hugetlbfs_commit_write + .readpage = hugetlbfs_readpage, + .writepage = fail_writepage, + .prepare_write = hugetlbfs_prepare_write, + .commit_write = hugetlbfs_commit_write, }; struct file_operations hugetlbfs_file_operations = { -mmap : hugetlbfs_file_mmap, -fsync : hugetlbfs_sync_file, -get_unmapped_area : hugetlb_get_unmapped_area, + .mmap = hugetlbfs_file_mmap, + .fsync = hugetlbfs_sync_file, + .get_unmapped_area = hugetlb_get_unmapped_area, }; static struct inode_operations hugetlbfs_dir_inode_operations = { -create : hugetlbfs_create, -lookup : hugetlbfs_lookup, -link : hugetlbfs_link, -unlink : hugetlbfs_unlink, -symlink : hugetlbfs_symlink, -mkdir : hugetlbfs_mkdir, -rmdir : hugetlbfs_rmdir, -mknod : hugetlbfs_mknod, -rename : hugetlbfs_rename, -setattr : hugetlbfs_setattr, + .create = hugetlbfs_create, + .lookup = hugetlbfs_lookup, + .link = hugetlbfs_link, + .unlink = hugetlbfs_unlink, + .symlink = hugetlbfs_symlink, + .mkdir = hugetlbfs_mkdir, + .rmdir = hugetlbfs_rmdir, + .mknod = hugetlbfs_mknod, + .rename = hugetlbfs_rename, + .setattr = hugetlbfs_setattr, }; static struct inode_operations hugetlbfs_inode_operations = { -setattr: hugetlbfs_setattr, + .setattr = hugetlbfs_setattr, }; static struct super_operations hugetlbfs_ops = { -statfs : hugetlbfs_statfs, -put_inode : hugetlbfs_drop_inode, + .statfs = hugetlbfs_statfs, + .put_inode = hugetlbfs_drop_inode, }; -static struct super_block * hugetlbfs_fill_super(struct super_block * sb, void * data, int silent) +static struct super_block * +hugetlbfs_fill_super(struct super_block * sb, void * data, int silent) { struct inode * inode; struct dentry * root; diff -Nru a/ipc/shm.c b/ipc/shm.c --- a/ipc/shm.c Wed Oct 8 09:06:58 2003 +++ b/ipc/shm.c Wed Oct 8 09:06:58 2003 @@ -126,8 +126,8 @@ shm_tot -= (shp->shm_segsz + PAGE_SIZE - 1) >> PAGE_SHIFT; shm_rmid (shp->id); shm_unlock(shp->id); - if(!is_file_hugepages(shp->shm_file)) - shmem_lock(shp->shm_file, 0); + if (!is_file_hugepages(shp->shm_file)) + shmem_lock(shp->shm_file, 0); fput (shp->shm_file); kfree (shp); } @@ -195,12 +195,11 @@ shp = (struct shmid_kernel *) kmalloc (sizeof (*shp), GFP_USER); if (!shp) return -ENOMEM; - if(shmflg & SHM_HUGETLB) + if (shmflg & SHM_HUGETLB) file = hugetlb_zero_setup(size); - else - { - sprintf (name, "SYSV%08x", key); - file = shmem_file_setup(name, size); + else { + sprintf (name, "SYSV%08x", key); + file = shmem_file_setup(name, size); } error = PTR_ERR(file); if (IS_ERR(file)) @@ -221,10 +220,10 @@ shp->id = shm_buildid(id,shp->shm_perm.seq); shp->shm_file = file; file->f_dentry->d_inode->i_ino = shp->id; - if(shmflg & SHM_HUGETLB) + if (shmflg & SHM_HUGETLB) set_file_hugepages(file); else - file->f_op = &shm_file_operations; + file->f_op = &shm_file_operations; shm_tot += numpages; shm_unlock (id); return shp->id; @@ -462,8 +461,8 @@ tbuf.shm_ctime = shp->shm_ctim; tbuf.shm_cpid = shp->shm_cprid; tbuf.shm_lpid = shp->shm_lprid; - if(!is_file_hugepages(shp->shm_file)) - tbuf.shm_nattch = shp->shm_nattch; + if (!is_file_hugepages(shp->shm_file)) + tbuf.shm_nattch = shp->shm_nattch; else tbuf.shm_nattch = file_count(shp->shm_file)-1; shm_unlock(shmid); @@ -487,12 +486,12 @@ if(err) goto out_unlock; if(cmd==SHM_LOCK) { - if(!is_file_hugepages(shp->shm_file)) - shmem_lock(shp->shm_file, 1); + if (!is_file_hugepages(shp->shm_file)) + shmem_lock(shp->shm_file, 1); shp->shm_flags |= SHM_LOCKED; } else { - if(!is_file_hugepages(shp->shm_file)) - shmem_lock(shp->shm_file, 0); + if (!is_file_hugepages(shp->shm_file)) + shmem_lock(shp->shm_file, 0); shp->shm_flags &= ~SHM_LOCKED; } shm_unlock(shmid); diff -Nru a/mm/memory.c b/mm/memory.c --- a/mm/memory.c Wed Oct 8 09:06:58 2003 +++ b/mm/memory.c Wed Oct 8 09:06:58 2003 @@ -182,9 +182,9 @@ unsigned long end = vma->vm_end; unsigned long cow = (vma->vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; - if (is_vm_hugetlb_page(vma)) { + if (is_vm_hugetlb_page(vma)) return copy_hugetlb_page_range(dst, src, vma); - } + src_pgd = pgd_offset(src, address)-1; dst_pgd = pgd_offset(dst, address)-1; @@ -1379,7 +1379,7 @@ current->state = TASK_RUNNING; pgd = pgd_offset(mm, address); - if(is_vm_hugetlb_page(vma)) + if (is_vm_hugetlb_page(vma)) return 0; /* mapping truncation does this. */ /* diff -Nru a/mm/mmap.c b/mm/mmap.c --- a/mm/mmap.c Wed Oct 8 09:06:58 2003 +++ b/mm/mmap.c Wed Oct 8 09:06:58 2003 @@ -595,10 +595,10 @@ fput(file); /* Undo any partial mapping done by a device driver. */ - if(is_vm_hugetlb_page(vma)) + if (is_vm_hugetlb_page(vma)) zap_hugepage_range(vma, vma->vm_start, vma->vm_end-vma->vm_start); else - zap_page_range(mm, vma->vm_start, vma->vm_end - vma->vm_start); + zap_page_range(mm, vma->vm_start, vma->vm_end - vma->vm_start); free_vma: kmem_cache_free(vm_area_cachep, vma); return error; @@ -655,16 +655,16 @@ if (addr & ~PAGE_MASK) return -EINVAL; if (file && is_file_hugepages(file)) - /* If the request is for hugepages, then make sure that addr - * and length is properly aligned. - */ + /* If the request is for hugepages, then make sure + * that addr and length is properly aligned. + */ ret = is_aligned_hugepage_range(addr, len); else - /* - * Make sure that a normal request is not falling - * in reserved hugepage range. For some archs like IA-64, - * there is seperate region for hugepages. - */ + /* + * Make sure that a normal request is not falling + * in reserved hugepage range. For some archs like + * IA-64, there is a separate region for hugepages. + */ ret = is_invalid_hugepage_range(addr, len); if (ret) return ret; @@ -1023,7 +1023,7 @@ if (is_vm_hugetlb_page(mpnt)) zap_hugepage_range(mpnt, st, size); else - zap_page_range(mm, st, size); + zap_page_range(mm, st, size); /* * Fix the mapping, and free the old area if it wasn't reused. @@ -1183,7 +1183,7 @@ if (is_vm_hugetlb_page(mpnt)) zap_hugepage_range(mpnt, start, size); else - zap_page_range(mm, start, size); + zap_page_range(mm, start, size); if (mpnt->vm_file) fput(mpnt->vm_file); kmem_cache_free(vm_area_cachep, mpnt);